package Application;

import java.io.*;

import Manage.ModelMgr;

public class App {
	public static void genModel(String level)
	{
		File sourceFile;
		String userDir = System.getProperty("user.dir");
		// set the sourcePath
		String sourceFileStr = userDir + "\\..\\" + "Case" + "\\"
				+ "DEVSMO_" + level + ".owl";
		sourceFile = new File(sourceFileStr);
		ModelMgr modelMgr = ModelMgr.getInstance();
		try {
			modelMgr.loadModel(sourceFile);
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
			System.out
					.println("Can't find the soure *.owl file! The program is end!");
			System.exit(0);
		}
		String targetPath = userDir + "\\Model" + "\\" + level;
		try {
			modelMgr.generateModel(targetPath);
			System.out.println("Translation Process Succeeds!");
		} catch (FileNotFoundException e) {
			System.out.println("Generate Model Failed!!");
			e.printStackTrace();
		}
		
		
		
	}

	// the main method
	public static void main(String[] args) {
//		genModel("PCS");
		genModel("MES");
//		genModel("ERP");
	}
}

